package afterVote;

import java.awt.event.ActionListener;

public class AfterVotePanel extends javax.swing.JPanel
{
    public void addButtonsActionListener( ActionListener l )
    {
        notEncodedButton.addActionListener( l );
        retryButton.addActionListener( l );
    }

    public void setInfoText( String text )
    {
        topInfoLabel.setText( text );
    }

    /** Creates new form AfterVotePanel */
    public AfterVotePanel()
    {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings( "unchecked" )
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents()
    {
        topInfoLabel = new javax.swing.JTextField();
        topInfoLabel.setEditable( false );
        retryButton = new javax.swing.JButton();
        notEncodedButton = new javax.swing.JButton();
        topInfoLabel.setText( "Voting in progress..." );
        retryButton.setText( "Send using TOR network" );
        notEncodedButton.setText( "Send normally" );
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout( this );
        this.setLayout( layout );
        layout.setHorizontalGroup( layout
                .createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING )
                .addGroup(
                    layout.createSequentialGroup().addContainerGap().addComponent( topInfoLabel ).addContainerGap( 289, Short.MAX_VALUE ) )
                .addGroup(
                    javax.swing.GroupLayout.Alignment.TRAILING,
                    layout.createSequentialGroup().addContainerGap( 193, Short.MAX_VALUE ).addComponent( retryButton ).addGap( 18, 18, 18 )
                            .addComponent( notEncodedButton ).addContainerGap() ) );
        layout.setVerticalGroup( layout.createParallelGroup( javax.swing.GroupLayout.Alignment.LEADING ).addGroup(
            layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent( topInfoLabel )
                    .addPreferredGap( javax.swing.LayoutStyle.ComponentPlacement.RELATED, 230, Short.MAX_VALUE )
                    .addGroup(
                        layout.createParallelGroup( javax.swing.GroupLayout.Alignment.BASELINE ).addComponent( retryButton )
                                .addComponent( notEncodedButton ) ).addContainerGap() ) );
        notEncodedButton.setEnabled( true );
        retryButton.setEnabled( true );
    }// </editor-fold>

    // Variables declaration - do not modify
    private javax.swing.JButton notEncodedButton;
    private javax.swing.JButton retryButton;
    private javax.swing.JTextField topInfoLabel;
    // End of variables declaration
}
